package com.game.majiang.algorithm.chexuan;

import java.util.ArrayList;

public class ClubunionAZ {
	/**
	 * 传过来俱乐部或者联盟所有辅助字母数字找到还剩余的第一个对应数字
	 * @param list
	 * @return
	 */
	public static int remaining(ArrayList<Integer> list) {
		int a=0;
		if(list!=null&&list.size()>0) {
			ArrayList<Integer> list1=new ArrayList<Integer>();
			for(int i=0;i<list.size();i++) {
				list1.add(list.get(i));
			}
			
			for(int o=1;o<=26;o++) {
				boolean f=false;
				for(int i=0;i<list1.size();i++) {
					if(o==list1.get(i)) {
						f=true;
						break;
					}
				}
				if(!f) {
					a=o;
					break;
				}
			}
		}else {
			a=1;
		}
		
		return a;
	}
	/**
	 * 
	 * @param a
	 * @return
	 */
	public static String letter(int a) {
		String s=null;
		switch (a) {
		case 1:
			s="A";
			break;
		case 2:
			s="B";
			break;
		case 3:
			s="C";
			break;
		case 4:
			s="D";
			break;
		case 5:
			s="E";
			break;
		case 6:
			s="F";
			break;
		case 7:
			s="G";
			break;
		case 8:
			s="H";
			break;
		case 9:
			s="I";
			break;
		case 10:
			s="J";
			break;
		case 11:
			s="K";
			break;
		case 12:
			s="L";
			break;
		case 13:
			s="M";
			break;
		case 14:
			s="N";
			break;
		case 15:
			s="O";
			break;
		case 16:
			s="P";
			break;
		case 17:
			s="Q";
			break;
		case 18:
			s="R";
			break;
		case 19:
			s="S";
			break;
		case 20:
			s="T";
			break;
		case 21:
			s="U";
			break;
		case 22:
			s="V";
			break;
		case 23:
			s="W";
			break;
		case 24:
			s="X";
			break;
		case 25:
			s="Y";
			break;
		case 26:
			s="Z";
			break;
																

		default:
			break;
		}
		return s;
	}
	
	public static int remaininguser(ArrayList<Integer> list) {
		int a=0;
		if(list!=null&&list.size()>0) {
			ArrayList<Integer> list1=new ArrayList<Integer>();
			for(int i=0;i<list.size();i++) {
				list1.add(list.get(i));
			}
			
			for(int o=1;o<=999;o++) {
				boolean f=false;
				for(int i=0;i<list1.size();i++) {
					if(o==list1.get(i)) {
						f=true;
						break;
					}
				}
				if(!f) {
					a=o;
					break;
				}
			}
		}else {
			a=1;
		}
		
		return a;
	}
}
